import ajax from './index'

export function agency_account_list(condition) {
  if (!condition) {
    condition = {
      pageNum: 1,
      pageSize: 20
    }
  }
  return ajax({
    url: "/pms/admin/list",
    method: "get",
    params: condition
  });
}

export function agency_role_list() {
  return ajax({
    url: "/pms/admin/role/list",
    method: "get"
  });
}
export function agency_account_register(param) {
  return ajax({
    url: "/pms/admin/register",
    method: "post",
    data: param
  });
}

export function agency_account_detail(id) {
  return ajax({
    url: "/pms/admin/detail" + "/" + id,
    method: "get"
  });
}
export function agency_account_update(id, param) {
  return ajax({
    url: "/pms/admin/update" + "/" + id,
    method: "post",
    data: param
  });
}
export function agency_account_delete(id) {
  return ajax({
    url: "/pms/admin/delete" + "/" + id,
    method: "post"
  });
}
export function agency_account_update_password(data) {
  return ajax({
    url: "/pms/admin/updatePassword",
    method: "post",
    data: data
  });
}

export function agency_menus() {
  return ajax({
    url: "/pms/admin/role/menus",
    method: "get"
  });
}
export function agency_role_create(param) {
  return ajax({
    url: "/pms/admin/role/create",
    method: "post",
    data: param
  });
}

export function agency_role_detail(id) {
  return ajax({
    url: "/pms/admin/role/detail" + "/" + id,
    method: "get"
  });
}
export function agency_role_edit(id, param) {
  return ajax({
    url: "/pms/admin/role/edit" + "/" + id,
    method: "post",
    data: param
  });
}
export function agency_role_delete(id) {
  return ajax({
    url: "/pms/admin/role/delete" + "/" + id,
    method: "post"
  });
}

export function agency_categories(parent_id) {
  return ajax({
    url: "/pms/admin/categories/" + parent_id,
    method: "get"
  });
}

export function agency_is1688() {
  return ajax({
    url: "/pms/admin/is1688",
    method: "get"
  });
}

export function agency_isJd() {
  return ajax({
    url: "/pms/admin/isJd",
    method: "get"
  });
}
export function admin_dashboard() {
  return ajax({
    url: "/pms/admin/dashboard",
    method: "get"
  });
}

export function agency_cat_tree() {
  return ajax({
    url: "/pms/admin/cat_tree",
    method: "get"
  });
}

export function agency_money() {
  return ajax({
    url: "/pms/admin/money",
    method: "get"
  });
}

export function agency_info() {
  return ajax({
    url: "/pms/admin/partner_info",
    method: "get"
  });
}
export function agency_update_bank(param) {
  return ajax({
    url: "/pms/admin/update_bank",
    method: "post",
    data: param
  });
}

export function agency_summary(param) {
  return ajax({
    url: "/pms/admin/summary",
    method: "get",
    params: param
  });
}

export function agency_dashboard(param) {
  return ajax({
    url: "/pms/admin/dashboard",
    method: "get",
    params: param
  });
}
export function agency_withdraw_apply(data) {
  return ajax({
    url: "/pms/admin/withdraw_apply",
    method: "post",
    data: data
  });
}

export function agency_withdraw_list(condition) {
  if (!condition) {
    condition = {
      pageNum: 1,
      pageSize: 20
    }
  }
  return ajax({
    url: "/pms/admin/withdraw_list",
    method: "get",
    params: condition
  });
}

export function agency_money_record_list(condition) {
  if (!condition) {
    condition = {
      pageNum: 1,
      pageSize: 100
    }
  }
  return ajax({
    url: "/pms/admin/money_record_list",
    method: "get",
    params: condition
  });
}

export function agency_money_record_list_export(condition) {
  return ajax({
    url: "/pms/admin/money_record_list_export",
    method: "get",
    params: condition
  });
}
